/*******************************************************************************
* File Name: coordinate_transforms.h
* Version 1.00
*
* Description:
*  This file provides the source code to the API for the Sequencing Successive
*  Approximation ADC Component Component.
*
* Note:*
********************************************************************************
* Copyright 2010-2019, CMS Semiconductor Corporation.  All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/

#ifndef __COORDINATE_TRANSFORMS_H__
#define __COORDINATE_TRANSFORMS_H__

 #ifdef __cplusplus
extern "C"
{
#endif

/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include<stdint.h>

/*****************************************************************************/
/* Global pre-processor symbols/macros ('#define') */
/*****************************************************************************/
#define Q12_INVSQRT3   	0x093C
#define Q12_2INVSQRT3  	0x1279
#define Q12_SQRT3      	0x1BB6
					
/*****************************************************************************/
/* Global type definitions ('typedef') */
/*****************************************************************************/
typedef struct {
	int32_t Q8_U;
	int32_t Q8_V;
	int32_t Q8_W;
} stc_uvwAxis_t;

typedef struct {
	int32_t Q8_Alpha;
	int32_t Q8_Beta;
} stc_abAxis_t;

typedef struct {
	int32_t Q8_d;
	int32_t Q8_q;
	int32_t Q12_Cos;
	int32_t Q12_Sin;
} stc_dqAxis_t;

/*****************************************************************************/
/* Global variable declarations ('extern', definition in C source) */
/*****************************************************************************/


/*****************************************************************************/
/* Global function prototypes ('extern', definition in C source) */
/*****************************************************************************/
extern void ClarkeTransform(stc_uvwAxis_t *Input, stc_abAxis_t *Output);

extern void ParkTransform(stc_abAxis_t *Input, stc_dqAxis_t *Output);

extern void InvertClackeTransform(stc_abAxis_t *Input, stc_uvwAxis_t *Output);

extern void InvertParkTransform(stc_dqAxis_t *Input, stc_abAxis_t *Output);


#ifdef __cplusplus
}
#endif

#endif /* __COORDINATE_TRANSFORMS_H__ */

